package com.hello.system.service.impl;

import java.util.List;
import com.hello.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hello.system.mapper.ChatTopicsMapper;
import com.hello.system.domain.ChatTopics;
import com.hello.system.service.IChatTopicsService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

/**
 * 聊天话题分类Service业务层处理
 * 
 * @author hello
 * @date 2025-05-15
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class ChatTopicsServiceImpl extends ServiceImpl<ChatTopicsMapper, ChatTopics> implements IChatTopicsService 
{
    private final ChatTopicsMapper chatTopicsMapper;

    /**
     * 查询聊天话题分类
     * 
     * @param topicId 聊天话题分类主键
     * @return 聊天话题分类
     */
    @Override
    public ChatTopics selectChatTopicsByTopicId(Long topicId)
    {
        return chatTopicsMapper.selectChatTopicsByTopicId(topicId);
    }

    /**
     * 查询聊天话题分类列表
     * 
     * @param chatTopics 聊天话题分类
     * @return 聊天话题分类
     */
    @Override
    public List<ChatTopics> selectChatTopicsList(ChatTopics chatTopics)
    {
        return chatTopicsMapper.selectChatTopicsList(chatTopics);
    }

    /**
     * 新增聊天话题分类
     * 
     * @param chatTopics 聊天话题分类
     * @return 结果
     */
    @Override
    public int insertChatTopics(ChatTopics chatTopics)
    {
        chatTopics.setCreateTime(DateUtils.getNowDate());
        return chatTopicsMapper.insertChatTopics(chatTopics);
    }

    /**
     * 修改聊天话题分类
     * 
     * @param chatTopics 聊天话题分类
     * @return 结果
     */
    @Override
    public int updateChatTopics(ChatTopics chatTopics)
    {
        chatTopics.setUpdateTime(DateUtils.getNowDate());
        return chatTopicsMapper.updateChatTopics(chatTopics);
    }


    /**
     * 批量删除聊天话题分类
     * 
     * @param topicIds 需要删除的聊天话题分类主键
     * @return 结果
     */
    @Override
    public int deleteChatTopicsByTopicIds(Long[] topicIds)
    {
        return chatTopicsMapper.deleteChatTopicsByTopicIds(topicIds);
    }

    /**
     * 删除聊天话题分类信息
     * 
     * @param topicId 聊天话题分类主键
     * @return 结果
     */
    @Override
    public int deleteChatTopicsByTopicId(Long topicId)
    {
        return chatTopicsMapper.deleteChatTopicsByTopicId(topicId);
    }
}
